package com.homework.hw1102.test4;

public class Company implements Money {
    Manager manager = new Manager();
    Clerk clerk = new Clerk();
    @Override
    public void salary(Emp emp, int n) {
        double totalSal = 0;
        if (emp instanceof Manager){
            totalSal = manager.getBonus()+manager.getSal();
            manager.setSaving(totalSal*n);
        }else if (emp instanceof Clerk){
            totalSal = clerk.getSal();
            clerk.setSaving(totalSal*n);
        }
        System.out.println(emp.getName()+"的薪资:"+emp.getSal()+" | 银行卡余额为:"+emp.getSaving());




    }
}
